//
//  UIScrollView+Kpop.m
//  bestkeep
//
//  Created by Canny on 2017/4/8.
//  Copyright © 2017年 utouu. All rights reserved.
//

#import "UIScrollView+Kpop.h"
#import "UIView+ParentController.h"
#import "BKMyOrderViewController.h"
#import "BKGDMainViewController.h"
#import "BKClassifyGoodsListViewController.h"
#import "BK_My_CupVC.h"
@implementation UIScrollView (Kpop)
//-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
//    if ([[UIView BKcurrentViewController] isKindOfClass:[BKMyOrderViewController class]]||[[UIView BKcurrentViewController] isKindOfClass:[BK_My_CupVC class]]||[[UIView BKcurrentViewController] isKindOfClass:[BKClassifyGoodsListViewController class]]||[[UIView BKcurrentViewController] isKindOfClass:[BKGDMainViewController class]]) {
//        return YES;
//    }
//    return NO;
//}
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
    // 判断 otherGestureRecognizer 是不是系统 POP 手势
    if ([otherGestureRecognizer.view isKindOfClass:NSClassFromString(@"UILayoutContainerView")]) {
        // 判断 POP 手势的状态是 begin 还是 fail，同时判断 scrollView 的 ContentOffset.x 是不是在最左边
        if (otherGestureRecognizer.state == UIGestureRecognizerStateBegan && self.contentOffset.x == 0) {
            return YES;
        }
    }
    return NO;
}
@end
